home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1998 May / Software of the Month Club 1998 May.iso / pc / dos / lg / text_m28 / tm.doc < prev    next >
Encoding:
Text File  |  1998-03-03  |  15.8 KB  |  308 lines

  1.  
  2.                              Text Modifier V2.8
  3.  
  4.                              by John Augustine
  5.  
  6.  TM (Text Modifier) was written in Assembly for MS Dos systems.  Requires
  7. Color Graphics CGA or better. Does not need a lot of memory. I have tested TM
  8. on an old 8088 Computer and a Computer with the Pentium.
  9.  
  10.  NOTE: See "IMPROVE.DOC" for more Information about New Features.
  11.  
  12.  There are times when you would like to Automatically Modify a Document/s,
  13. which is too much trouble to do manually using a Word Processor or Text
  14. Editor.  TM to the "Rescue".
  15.  
  16.  TM Creates another Text file/s, or Prints a Text file with or without
  17. Modifications. The original Input Text file/s is NEVER altered.
  18.  
  19.   Some optional TM features are:
  20.  
  21.  1. A "Stripper" which can Remove parts of every line.
  22.  2. Replace all non-Text (except CR,LF) characters with spaces.
  23.  3. Convert all lower case letters to Upper case.
  24.  4. View "Long Line" (more than 80 characters long) Documents by Wrapping
  25.     (not Word Wrap) at the 80th column.
  26.  5. Reformat large Documents for Printing more efficiently.  In some cases,
  27.     using only 1/3 the amount of paper!
  28.  
  29.  6. "Modify" Text as follows:
  30.  
  31.   1.1 Remove a specified number of spaces from the beginning of every line.
  32.   1.2 Remove a specified number of spaces from the end of every line.
  33.       NOTE: 1.1 and 1.2 removes the specified number of spaces or less. The
  34.       user specified amount is actually the Maximum Limit.
  35.   1.3 Remove a specified Sequence of spaces (lower amounts are ignored)
  36.       anywhere in text.
  37.   2.  Reduce a Character/s or Pattern Sequence to a specified amount.
  38.   3.  Remove a Character/s or Pattern Sequence.
  39.   4.  Replace a Character/s or Pattern Sequence with another.
  40.   5.  Keep (Extract) lines from a Document that contain a specified Pattern.
  41.   6.  Keep all lines except (Exclude) lines that contain a specified Pattern.
  42.   7.  Other Modify Options:
  43.   7.1 Clip a Portion/s of a Text file. Uses Line Number (User Input) counter
  44.       reference.
  45.   7.2 Reformat and/or Add CRs (+LFs) to a Text File.
  46.  
  47.   Note: 2,4,5,and 6 have three Categories of Character Patterns while 3 has
  48. four Categories:
  49.  
  50.   A. Case Sensitive.
  51.   B. Case Insensitive.
  52.   C. Numbers (Decimal) which can represent Non-Text Characters eg.
  53.      Control characters. Example 13 = Carriage Return, 10 = Line Feed, etc.
  54.  
  55.   Note: "Modify" 3 (Remove ....) also has the Option to Remove everything
  56.   between Two Specified Patterns including the Two Patterns.
  57.  
  58.   When I refer to CR (Carriage Return), it should be understood that it
  59. usually is accompanied by a LF (Line Feed). When I use "Modifications" (in
  60. quotes), I am referring to the Procedures relative to "Modify Parameters".
  61. These are not the only Procedures that actually modify a file by TM. Consider
  62. them the main Modification procedures.
  63.  
  64.   EXAMPLES OF TM'S USEFULNESS:
  65.  
  66.   Note: Examples 1, 2, 3 relate to a List of Program Files (Files available at
  67. a BBS or FTP Site)
  68.  
  69.  1. To see (via "View...") only 1997 Files in the List.  Select "Modify"
  70. option number 5 and enter /97 for the Pattern. Select "View..." in Main Menu.
  71. Don't confuse this with Text Editor's Search.  TM will display a Screen full
  72. (View many at one time), instead of one at a time, as in a Text Editor's
  73. Search.  Note: This will not show you additional Lines of information for each
  74. file, if your List contains them.
  75.  
  76.  2. To Create a File (List) of only GIF files, select Modify option number 5
  77. and enter Case Sensitive pattern ".GIF".  Only lines with that Pattern will go
  78. into the New File you are Creating.
  79.  
  80.  3. Removing unnecessary lines from the file using "Modify" 6:
  81.  
  82.   Enter Case Sensitive "DL Time" for the Pattern.  Check results with the
  83. "View...." and you should see all lines, Except those which contain Download
  84. information.  I'm assuming that it is a separate line.  Just look for
  85. something unique in lines you don't want.
  86.  
  87.  4. Just about all text editors and word processors can Replace one Pattern
  88. with another.  Can they replace Control characters eg. CRs?, Add LFs (Line
  89. Feed) to a Document that doesn't have any?  Add two CRs,LFs in place of one
  90. for Double space Printing?  Modify other Non-Text or Control characters?  TM
  91. can.  Here is an example for using TM's "Modify" option number 4 to add LFs to
  92. a document that contain only CRs:
  93.  
  94.  Select number 3. Enter the Decimal number 13 (CR) and press Enter. Next
  95. enter Decimal number 13,10 (10 is LF) for the "Replacement" Pattern and press
  96. enter. All CRs will be replaced by CRs and LFs.
  97.  
  98.  5. Here is an actual case I had using someone's "Vectors" Program.  The
  99. Computer's Interrupt Vectors displayed on the Screen, or Printed (Printer) in
  100. Columns was very nice.  When I redirected the Output to a File, there was no
  101. CRs anywhere in the Text, and everything "ran together".  Again, TM to the
  102. Rescue.  I selected "Modify" number 4.3 (Replace a Characters/Pattern using
  103. Numbers).  For the Pattern, I entered Decimal number 73 (Ascii number for
  104. Upper Case letter I (Int)).  For the Replace Pattern, I entered, 13,10,73
  105. (CR,LF,I).  The Modified File I created was properly formatted and easy to
  106. view. I simply replaced the "I", which was the first character of every line
  107. with a CR,LF, and Letter I (restore I).
  108.  
  109.  6. Reformating a "Long Line" Text file such as .WRI files so you can edit the
  110. file in a Dos based Text Editor. Use "Modify" option number 7.2 (Press 7, then
  111. select number 2). Enter 79 for up to 79 characters per line with Word Wrap.
  112.  
  113.  Tip: In some cases, if you have a large Document which does not display a
  114. "List" anywhere, you can Reformat ("Modify" 7.2) the Document for very
  115. Compressed Printing, say 200 or more Characters per Line (with Word Wrap).
  116. Talk about saving paper.
  117.  
  118.  7. With a New Feature (V2.7) added to "Modify 3", you can convert some forms
  119. of Text Files such as Hypertext to a regular Ascii Text file by Removing the
  120. embedded Parameters.  Example: "<Font Size =+3...>".  For the Left (Start)
  121. Pattern, I entered (without quotes) "<" and the Right (End) Pattern, I entered
  122. ">".  Everything between the "<" and ">" was Removed including "<>".  I
  123. Created a regular Ascii Text file that I can easily Read with any Ascii Text
  124. Viewer.
  125.  
  126.  8. With an Enhanced (V2.7) "Modify 2", I can Reduce a sequence of CR,LFs.  I
  127. received a Document that contained many Blank lines separating Paragraphs.  I
  128. wanted One Blank line between each Paragraph.  I entered for "Modify" 2.3,
  129. 13,10 for the Pattern and selected a Sequence of 2 which sets the Maximum
  130. Consecutive sequence of 13,10 to Two (Example: 13,10,13,10).  Note: The first
  131. "13,10" is the end of the last line in a paragraph and the second "13,10"
  132. creates the Blank Line.
  133.  
  134.  9. Printing a very large Document (Example: Program Instructions):
  135.  
  136.  Many Program Instructions are very large.  In some of them, all lines are
  137. indented 10 (some more, some less) spaces.  I used TM and Viewed the document.
  138. TM has a Scale and I used that to see how many spaces before the text starts.
  139. I selected "Modify" 1 for Space removal and selected 1 to remove spaces from
  140. the beginning of each line and entered 9, which leaves 1 Space at the
  141. beginning of each "Regular" Line, used to Separate the Last word of the
  142. previous line from the First word on the Next line.  I returned to Main Menu
  143. and toggled Back Page Printing to ON.  I selected "Print a Text File".  I
  144. selected 2, "Toggle Preserve Carriage Returns" to OFF. I selected 3, "Toggle
  145. Compress Mode (132 characters per line)" to ON.  Note: when you press 2 or 3,
  146. you will see a message with useful information. I printed the Document using a
  147. little more than 1/3 the amount of paper it normally would take.
  148.  
  149.  When I toggled Compress mode ON, and preserve Carriage Returns OFF, words
  150. from the next line are added to make longer lines with Word Wrap. Even with
  151. this set to OFF, lines in which text starts 2 or more spaces from the
  152. beginning will have their CR (Carriage Returns) Preserved, as well as lines
  153. with only a CR (used for creating blank lines between paragraphs).
  154.  
  155.  Here is an example of why there are Exceptions in the Procedure that is
  156. "told" NOT to preserve CRs.
  157.  
  158.   This is a part of Instructions for a Utility program:
  159.  
  160.  <CR>
  161.   A. Format a Disk<CR>
  162.   B. Delete a File<CR>
  163.   C. Rename a File<CR>
  164.   D. etc....
  165.  
  166.  The first CR was used to create a blank line. We would not want to remove
  167. that. The "List" of commands would end up in a line rather than in a column if
  168. this condition was overlooked. Remember, it is important that any "List" of
  169. commands, etc., be indented (usually is) at least two spaces in the document,
  170. when you turn Off Preserve CRs.
  171.  
  172.  It is Important therefore to Look at the Text First. Use "Read a Text File"
  173. so you can see the file in it's original form (unless "Long Line" text).  Try
  174. out different settings if you are not sure of the outcome.  Use "View a Text
  175. File" to see the results before you Print the file or Create another file.
  176. Note: Original File is Never Altered.
  177.  
  178.  NOTE: "Long Line" text refers to lines that are longer than 80 characters
  179. before ending with a CR. One source for "Long Line" Text is Windows based Text
  180. Editors.
  181.  
  182.  Note: Since Reformat Procedures are used by both the Printer routines (Not
  183. Preserve CRs) and "Modify" 7.2, you can't Reformat a file and Print it at the
  184. same time. TM will bring that to your attention if you try.
  185.  
  186.  Clipping ("Modify" 7.1) portions of a File allows you to enter line number
  187. references. Normally, you use the "Lines" number display at the bottom of the
  188. screen in "View" or "Read" Modes.  IMPORTANT: If you are Reformating ("Modify"
  189. 7.2) and Clipping ("Modify" 7.1) the File at the same time, use the "VIEW" (Not
  190. "Read") after setting the Reformat Parameters, in order to get the correct Line
  191. number/s reference.  Then set the Clipping Parameters.  Most text editors allow
  192. you to Clip portions of a text file, but TM is good for very large text files
  193. up to 65,535 lines.  There is an exception, if you were Clipping (removing) to
  194. the End of a file, "FROM" a Line reference that does NOT exceed 65,535, then
  195. the number of Lines in the File can be in the millions.
  196.  
  197.  Does it bother you when you can't see where the CRs are in your text?  Most
  198. Text editors and Word Processors that I have used don't display CRs.  TM makes
  199. them very obvious.  TM (V2.7) lets you see if the Document has both CR and LF
  200. (Normal) or just CR, by the Color of the Symbol used to represent a CR/LF
  201. (White = CR,LF and Magenta = CR without LF).
  202.  
  203.  I am going to stop here and tell you something about the Sequential Order
  204. in which "Modifications" and other Modifying (Stripping, etc.) functions occur
  205. on each "Line" of a document by TM.  Note: Documents without CRs, the "Line"
  206. ends at around 6,300 characters.  This may be important to know if a variety
  207. of Modifications are to be performed on the Document in one Pass (usually
  208. not). Let's assume all possible options are "Active".
  209.  
  210.   Sequential order of Modifications (if ALL are Active):
  211.  
  212.   1. Non-Text characters are replaced with Spaces.
  213.   2. Lower case letters converted to Uppercase.
  214.   3. Stripping (Removing) a part/s of each line.
  215.   4. "Modifications" (multiple modification procedures).
  216.  
  217.   "STRIPPING":
  218.  
  219.  Allows you to Remove parts of each line.  The lines Must have Uniform
  220. Columns unless you select the Pattern Strip.  The "Pattern" can be a Single
  221. Character, Word, etc.  You can Strip from the Beginning of each Line up to the
  222. Pattern (does Not include the Pattern) or From the Pattern (does Not include
  223. the Pattern) to the End of each Line.  NOTE: If you want the Pattern Removed
  224. too, use "Modify 3" to Remove the Pattern (the Same Pattern Entered for
  225. Stripping).  NOTE: "Stripping" operates on each Line before "Modifications".
  226. Character Counting reference is the other form (No Pattern) of Stripping.
  227.  
  228.  Note: "Stripping" removes a part/s of each line while "Clipping" ("Modify"
  229. 7.1) removes parts of the File by Lines.
  230.  
  231.  The "Modifications" order is just as they are numbered except with "Modify"
  232. number 7 (added later). Now the "Modification" order is:
  233.  
  234.  7.2 (Reformat or Add CRs to Text).
  235.  7.1 Clip a Portion/s of the Text file (Clip by lines).
  236.  1 to 6 are in the proper order (following "Modification" 7).
  237.  
  238.  Example: Number 1 for Spaces removal comes first.  Number 2 to reduce a
  239. sequence of characters, is second, etc. If all possible Modifications are
  240. being used, each line is Modified in turn, starting with number 7 parameters,
  241. then number 1,2,3,4,5 or 6 (you can't have both 5 and 6 active at the same
  242. time). You should be aware of this since some odd affects can result if you
  243. don't think about the order. Here is a simple example:  You use option number
  244. 3 to remove a pattern and entered the same pattern in option 4 to replace it
  245. with another. By the time number 4 operates on the line, the pattern won't be
  246. there (removed by "Modify" number 3).
  247.  
  248.  For "Modifications" 1 to 6 (except 3), there are 3 categories: Case
  249. Sensitive, Insensitive, and Numbers (Decimal) that represent characters
  250. (usually used for non-Text such as Control characters, but can also be Text
  251. characters). These are performed in the same sequential order as their
  252. numbers.
  253.  
  254.  IMPORTANT NOTES:
  255.  
  256.  1. IF you "Modify" a file (Create another File) and you notice that it is
  257. smaller than the Original, one possible reason could be that the Original File
  258. contained Zeros.  Since a Zero is used as an End of Line reference during
  259. "Modifications", all Zeros that are found in the Original File are discarded.
  260.  
  261.  2. Since there is such a wide range of possible combinations in performing
  262. more than one Modification on a File at the same time, I have no way of
  263. knowing about the possibility of conflicts.  However, you need not worry if
  264. the outcome is not what you expected since the ORIGINAL FILE is NEVER Altered.
  265. The "View a File" allows you to Preview the outcome of Modifications before
  266. you decide to Print or Create another File.  I do know if you are Clipping
  267. ("Modify" 7.1) a "Long Line" text file, and at the same time, you are
  268. Replacing ("Modify" 4) or Removing ("Modify" 3) a Pattern, there is a
  269. possibility that the Pattern could be spilt and not found to be Replaced or
  270. Removed.  The Pattern will NOT be lost because it is split, but it won't be
  271. changed or removed.  Since "Clipping" counts Screen Lines (up to 80 characters
  272. per Screen Line) as a reference, "Long Line" text is ended in the Line Buffer
  273. at 80 characters for Line Counting (Clipping reference).  The solution is
  274. SIMPLE, perform the Clipping "Modification" on a second Pass.
  275.  
  276.  3. Modifications on Documents without the standard CR,LF (or CR) ending each
  277. line may not always be complete due to the Limited size of the Line Buffer.
  278. It is possible for a "Pattern", which contains more that one word, to be
  279. Split, one word of a two word pattern can be in one "Line" (near End of Line
  280. Buffer) while the second word will be in the next "line".  This also applies
  281. to reducing a Sequence, etc.
  282.  
  283.  4. TM was NOT designed to be totally "Idiot" proof.  One example: For
  284. "Modifications", if you enter letters instead of numbers at the Numbers
  285. category, the outcome is uncertain (I never tried it).
  286.  
  287.   CONCLUSION:
  288.  
  289.   This is NOT a "Free" program.  A small Donation will be Greatly Appreciated.
  290. For a Minimum of $5.00 (U.S.A.), I will send you several other MS Dos Programs
  291. that I made on a 3.5" Disk, or Attach it (.ZIP Package) to E-Mail to you if you
  292. prefer.  The Donation will Motivate me to Develop more Programs (and make
  293. Improvements).
  294.  
  295.   By request, I will send you a List of my other Programs (with descriptions)
  296. in E-Mail or "Snail Mail" (send a S.A.S.E.).
  297.  
  298.   Comments or Complaints are always welcomed.  If you use "Snail Mail" and
  299. expect a reply, please include a S.A.S.E.
  300.  
  301.               E-Mail: jaugust@bellatlantic.net
  302.  
  303.                       John Augustine N3AOF
  304.                       3129 Earl St.
  305.                       Laureldale, Pa 19605
  306.                       (610) 929-8850
  307.  
  308.